<template>
	<view>
		<view style="background: #F9D31F; height: 100%; overflow: hidden;">
			<scroll-view :refresher-threshold="45" :refresher-enabled="true" :refresher-triggered="refresherTriggered"
				@refresherrefresh="refresherrefresh" @refresherrestore="refresherrestore" @refresherabort="refresherabort"
				@scroll="scroll" style="height: 100vh;" class="scroller" :scroll-top="scrollTop" :scroll-into-view="toView"
				:scroll-y="true" :scroll-with-animation="true">
				<!-- <view :id="item" class="left" v-for="item in list">{{item.toUpperCase()}}</view> -->
				<image style="width: 100%;" mode="widthFix" :src="baseUrl.baseUrl+image[0]"></image>
				<view id="top" style="box-sizing: border-box; padding: 10px;">
					<view style="line-height: 40px;">
						美亿联美业平台 地区精选商家 地区异业联盟
					</view>
					<view style="background: #352C2E; border-radius: 12px; box-sizing: border-box;padding: 10px;">
						<!-- <u-parse :html="content"></u-parse> -->
						<image style="width: 100%;" mode="widthFix" :src="baseUrl.baseUrl+image[1]"></image>
		
					</view>
				</view>
				<view id="id1" style="box-sizing: border-box; padding: 10px;">
					<view style="background: #fff; border-radius: 12px; box-sizing: border-box; overflow: hidden;">
						<view style="box-shadow: 0 0 4px #FF9833;">
							<u-grid :col="2" border="true">
								<u-grid-item>
									<view style="color: #31AAFF;">
										{{form.join_num}}
									</view>
									<view>
										<u-icon name="account"></u-icon> 参与人数
									</view>
								</u-grid-item>
								<u-grid-item>
									<view style="color:#FF9833;">
										{{form.access_num}}
									</view>
									<view>
										<u-icon name="eye"></u-icon> 访问量
									</view>
								</u-grid-item>
							</u-grid>
						</view>
						<view style="padding: 10px; overflow: hidden; box-sizing: border-box;">
							<view v-for="(item,index) in userlist" :key="index"
								style="width: 14.2%; float: left; text-align: center; margin-bottom: 6px;">
								<image style="width: 40px; height: 40px; border-radius: 50%;" :src="item.avatar"></image>
								<view style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
									{{item.nickname}}
								</view>
							</view>
						</view>
					</view>
				</view>
		</scroll-view>
		</view>
		
		<view id="id2" style="box-sizing: border-box; padding: 10px;">
			<view style="background: #fff; padding: 10px; border-radius: 12px; box-sizing: border-box; overflow: hidden;">
				<view style="text-align: center; line-height: 30px;">
					已有<text style="font-size: 24px; color: #FF4949;">{{form.store_num}}</text>家以上精选商户
				</view>
				<view style="text-align: center; line-height: 30px;">
					活动真实有效，大家放心购买
				</view>
		
				<view>
					<view v-for="(item,index) in getStoreList" @click="toDetail('/pages/shop/detail?id='+item.id)"
						style="width: 33.3%; float: left; box-sizing: border-box; padding: 0 5px;">
						<view>
							<view style="width: 100%; height: 86px; overflow: hidden; position: relative;">
								<image style="width: 100%;" mode="widthFix" :src="item.image_photo"></image>
								<view
									style="position: absolute; z-index: 1; width: 100%; padding: 4px; background: rgba(0,0,0,0.4); left: 0; bottom: 0; font-size: 12px; color: #fff; text-align: center;">
									{{item.name}}
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		
		<!-- <view class="t-login">
				<button style="background: #F88905; color: #fff;">光丽人就能 省1034944元</button>
			</view> -->
		
		
		<!-- 		<view style="box-sizing: border-box; padding: 10px;">
				<view style="background: #fff; padding: 10px; border-radius: 12px; box-sizing: border-box; overflow: hidden;">
					<view>
						<view v-for="(item,index) in goodsList" style="width: 33.3%; float: left; box-sizing: border-box; padding: 0 5px;">
							<view>
								<view style="width: 100%; height: 86px; overflow: hidden; position: relative;">
									<image style="width: 100%;" mode="widthFix" src="http://5b0988e595225.cdn.sohucs.com/images/20180620/b82e95db61bd4a658f25a6c8e3142b7f.jpeg"></image>
									<view style="position: absolute; z-index: 1; width: 100%; padding: 4px; background: rgba(0,0,0,0.4); left: 0; bottom: 0; font-size: 12px; color: #fff; text-align: center;">
										瑜伽美容养生
									</view>
								</view>
								<view style="font-size: 12px; line-height:30px; text-align: center;">
									免单价值<text style="font-size: 20px; color: #FF4949;">1276</text>元
								</view>
							</view>
						</view>
					</view>
				</view>	
			</view> -->
		
		
			<view id="id3" style="box-sizing: border-box; padding: 10px;">
				<view
					style="background: #fff; padding: 10px; border-radius: 12px; box-sizing: border-box; overflow: hidden;">
					<view style="text-align: center; line-height: 30px; font-weight: bold;">
						爱美/吃/喝/玩/乐/全都有
					</view>
					<view>
						<!-- <u-divider color="#F88905">商架分类</u-divider> -->
						<u-divider @click="toDetail('/pages/shop/dingdan')" color="#F88905" half-width="100"
							border-color="#F88905">商家分类</u-divider>
					</view>
					<view v-for="(item,index) in getStoreType" @click="toDetail('/pages/shop/dingdan?id='+item.id)"
						style=" margin-top: 10px; float: left; box-sizing: border-box; padding: 0 10px;">
						<view
							style="background: #E89839;padding: 0 10px; color: #fff; text-align: center; line-height: 30px; border-radius: 6px;">
							{{item.name}}
						</view>
					</view>
				</view>
			</view>
		</view>
		
		<view style="box-sizing: border-box; padding: 10px;">
			<view style="background: #fff; padding: 10px; border-radius: 12px; box-sizing: border-box; overflow: hidden;">
				<view style="text-align: center; line-height: 30px; font-weight: bold;">
					爱美/吃/喝/玩/乐/全都有
				</view>
				<view>
					<!-- <u-divider color="#F88905">商架分类</u-divider> -->
					<u-divider @click="toDetail('/pages/shop/dingdan')" color="#F88905" half-width="100"
						border-color="#F88905">商家分类</u-divider>
				</view>
				<view v-for="(item,index) in getStoreType" @click="toDetail('/pages/shop/dingdan?id='+item.id)"
					style=" margin-top: 10px; float: left; box-sizing: border-box; padding: 0 10px;">
					<view
						style="background: #E89839;padding: 0 10px; color: #fff; text-align: center; line-height: 30px; border-radius: 6px;">
						{{item.name}}
					</view>
				</view>
			</view>
		</view>
		
		<!-- 推荐商家 -->
		<view v-for="(item,index) in promotionStore" :key="index"
			style="box-sizing: border-box; padding: 10px; text-align: center;">
			<view
				style="background: #fff; padding: 10px; border-radius: 12px; box-sizing: border-box; overflow: hidden;">
				<view style="text-align: center; line-height: 30px; margin-bottom: 10px; font-weight: bold;">
					{{item.name}}
				</view>
		
				<view style="">
					<image style="width: 100%;" mode="widthFix" :src="item.image_photo"></image>
				</view>
			</view>
		
			<!-- 推荐商家 -->
			<view v-for="(item,index) in promotionStore" :key="index"
				style="box-sizing: border-box; padding: 10px; text-align: center;">
				<view
					style="background: #fff; padding: 10px; border-radius: 12px; box-sizing: border-box; overflow: hidden;">
					<view style="text-align: center; line-height: 30px; margin-bottom: 10px; font-weight: bold;">
						{{item.name}}
					</view>
		
					</view>
					<view style="line-height:30px ;">
						<view>
							商家免单福利
						</view>
						<view>
							总价值<text style="font-size: 14px; color: #FF4949;">{{item.total_market_value}}元</text>的免单福利
		
						</view>
						<view v-for="(items,i) in item.prohect" :key="i">
							{{i+1}}、{{items.name}}
						</view>
					</view>
		
			</view>
		
		<view>
			<view v-if="promotionStoretrue" @click="more"
				style="background:rgb(248, 137, 5); margin: auto; color: #fff; width: 100px; text-align: center; line-height: 30px; border-radius: 30px;">
				加载更多
			</view>
		
		
		<view id="id4" style="box-sizing: border-box; margin-top: 20px; padding: 10px;">
			<view style="background: #fff; padding: 10px; border-radius: 12px; box-sizing: border-box;">
				<image style="width: 100%;" mode="widthFix" :src="baseUrl.baseUrl+image[2]"></image>
				<!-- <view class="t-login" style="width: 200px;">
						<button style="background: #F88905; margin-top: -30px; color: #fff;">活动说明</button>
					</view>
					<view style="text-align: center; line-height: 40px; font-weight: bold;">
						致敬正在看此活动的您！
					</view>
					<view style="overflow: hidden; font-size: 14px; color: #666; line-height: 22px;">
						此次“城市生活免单节”活动的异业联盟全体商家做如下慎重承诺: 绝无套路我们把高额广告费直接回馈消费者!绝不浮夸! 我们免单的项
					</view>
					<view style="font-weight: bold; font-size: 12px; margin-top: 10px;">
						城市生活免单节异业联盟
					</view>
					<view style="font-size: 12px;">
						2021.09.20
					</view> -->
				</view>
			</view>
		</view>
		<view style="box-sizing: border-box; margin-top: 20px; padding: 10px;">
			<view style="background: #fff; padding: 10px; border-radius: 12px; box-sizing: border-box;">
				<image style="width: 100%;" mode="widthFix" :src="baseUrl.baseUrl+image[3]"></image>
				<!-- <view class="t-login" style="width: 200px;">
						<button style="background: #F88905; margin-top: -30px; color: #fff;">活动说明</button>
					</view>
					<view style="text-align: center; line-height: 40px; font-weight: bold;">
						致敬正在看此活动的您！
					</view>
					<view style="overflow: hidden; font-size: 14px; color: #666; line-height: 22px;">
						此次“城市生活免单节”活动的异业联盟全体商家做如下慎重承诺: 绝无套路我们把高额广告费直接回馈消费者!绝不浮夸! 我们免单的项
					</view>
					<view style="font-weight: bold; font-size: 12px; margin-top: 10px;">
						城市生活免单节异业联盟
					</view>
					<view style="font-size: 12px;">
						2021.09.20
					</view> -->
				</view>
			</view>
		</view>
		<view style="box-sizing: border-box; margin-top: 20px; padding: 10px;">
			<view style="background: #fff; padding: 10px; border-radius: 12px; box-sizing: border-box;">
				<image style="width: 100%;" mode="widthFix" :src="baseUrl.baseUrl+image[4]"></image>
				<!-- <view class="t-login" style="width: 200px;">
						<button style="background: #F88905; margin-top: -30px; color: #fff;">活动说明</button>
					</view>
					<view style="text-align: center; line-height: 40px; font-weight: bold;">
						致敬正在看此活动的您！
					</view>
					<view style="overflow: hidden; font-size: 14px; color: #666; line-height: 22px;">
						此次“城市生活免单节”活动的异业联盟全体商家做如下慎重承诺: 绝无套路我们把高额广告费直接回馈消费者!绝不浮夸! 我们免单的项
					</view>
					<view style="font-weight: bold; font-size: 12px; margin-top: 10px;">
						城市生活免单节异业联盟
					</view>
					<view style="font-size: 12px;">
						2021.09.20
					</view> -->
				</view>
			</view>
		
		
		<!-- <view style="box-sizing: border-box; margin-top: 20px; padding: 10px;">
				<view style="background: #fff; padding: 10px; border-radius: 12px; box-sizing: border-box;">
					<view class="t-login" style="width: 200px;">
						<button style="background: #F88905; margin-top: -30px; color: #fff;">关于免单节的疑问&解答</button>
					</view>
					<view v-for="(item,index) in 6" style="border-bottom: #F88905 solid 3px; padding-bottom: 10px;">
						<view style="font-weight: bold; line-height: 36px;">
							Q{{index+1}}、购买免单节福利后需要怎么享受优惠！
						</view>
						<view style="line-height: 22px; font-size: 12px;">
							A、参与城市生活免单节需到相对应的商家出示核销二维码即可 核销。
						</view>
					</view>
				</view>	
			</view>	 -->
		
			<view style="height: 50px;"></view>
			<navmenu @id="toid"></navmenu>
			<view>
				<view @click="showmodel=true" v-if="isshow"
					style="position: fixed; display: flex; z-index: 6; top: 50px; left: 10px;">
					<image style="width: 40px; height: 40px; margin-right: 10px; border-radius: 50%;" :src="avatars">
					</image>
					<view
						style="background: rgba(255,255,255,0.8); line-height: 40px; padding: 0 10px; border-radius: 8px; font-size: 14px; color: #000;">
						这个活动不错，快来参加吧！</view>
				</view>
				<view @click="toLogin" v-if="!isshow"
					style="position: fixed; display: flex; z-index: 6; top: 50px; left: 10px;">
					<image style="width: 40px; height: 40px; margin-right: 10px; border-radius: 50%;"
						src="../../static/missing-face.png"></image>
					<view
						style="background: rgba(255,255,255,0.8); line-height: 40px; padding: 0 10px; border-radius: 8px; font-size: 14px; color: #000;">
						去登录</view>
				</view>
				<image v-if="item.istrue" @click="gourl(item.type)" :key="index" v-for="(item,index) in imglist"
					:style="{bottom:item.bottom}"
					style="width: 60px; height: 60px; position: fixed; z-index: 1; right: 20px;" :src="item.img"></image>
			</view>
		
		
			<view
				style="height: 50px; text-align: center; display: flex; width: 100%; background: #fff; position: fixed; z-index: 1; bottom: 0; left: 0;">
				<view @click="call(kf_tel)" style="width: 50%; font-size: 12px;">
					<view>
						<image style="width: 30px; height: 30px;" src="/static/login/kefu.png"></image>
					</view>
					联系客服
				</view>
				<view style="width: 50%;">
					<view class="t-login" style="width: 160px; margin-top: 8px;">
						<button v-if="is_members!=1" @click="pay(image[0],payamount)"
							style="background: #F9D31F; height: 34px; line-height: 34px;">立即购买（{{payamount}}元）</button>
						<button v-else @click="fuwu"
							style="background: #F9D31F; height: 34px; line-height: 34px;">去服务</button>
					</view>
				</view>
			</view>
			<u-modal :show-cancel-button="true" @confirm="tc" v-model="showmodel" content="确认退出登录吗？"></u-modal>
			
		</view>
		
	</view>
</template>

<script>
	import authority from '@/pages/mixins/authority.js'
	import {
		mapActions,
		mapState
	} from 'vuex'
	import grouponBox from './child/grouponBox'
	import navmenu from '@/common/navmenu.vue'
	import baseUrl from '@/common/request/config.js'
	// getIndexImgTel
	export default {
		mixins: [authority],
		components: {
			grouponBox,
			navmenu
		},
		data() {
			return {
				refresherTriggered: true,
				promotionStoretrue: false,
				showmodel: false,
				avatars: '',
				userlist: [],
				oldScrollTop: 0,
				scrollTop: 0,
				toView: '',
				datas: [],
				getStoreType: [],
				page: 1,
				promotionStore: [],
				form: {},
				kf_tel: '',
				baseUrl: baseUrl,
				image: [],
				show: false,
				Data: ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1',
					'1', '1', '1', '1'
				],
				content: `
				<p style="line-height:30px;color: #fff;text-align: center;">致自己</p>
				<p style="line-height:30px;color: #fff;text-align: center;">从今天起，做一个热爱生活的人</p>
				<p style="line-height:30px;color: #fff;text-align: center;">美食，K歌，看电影</p>
				<p style="line-height:30px;color: #fff;text-align: center;">从今天起，关心身体和健康</p>
				<p style="line-height:30px;color: #fff;text-align: center;">美容，养生，爱自己</p>
				<p style="line-height:30px;color: #fff;text-align: center;">对自己，对家人好一点<span style="font-size:30px; color:#FF8787">很有必要</span></p>
				`,
				titleNViewBackground: '',
				swiperCurrent: 0,
				carouselList: [],
				navList: [],
				goodsList: ['1', '1', '1', '1', '1', '1'],
				adList: [],
				payamount: '',
				data: {},
				phone: '',
				userid: '',
				getStoreList: [],
				is_members: '',
				isshow: false,
				userinfo: uni.getStorageSync('token'),
				imglist: [{
						img: '/static/login/top.png',
						bottom: '70px',
						istrue: true,
						type: 'top'
					},
					{
						img: '/static/login/grzx.png',
						bottom: '140px',
						istrue: false,
						type: 'grzx'
					},
					{
						img: '/static/login/sjru.png',
						bottom: '210px',
						istrue: false,
						type: 'sjru'
					}
				]
			};
		},
		onShow() {
			this.getuser()
			this.getlist()
		},
		onPullDownRefresh() {
			// this.loadData()
		},
		onLoad(e) {
			// uni.navigateTo({
			// 	url:'/pagesuser/order/order'
			// })

			if (e.phone) {
				this.phone = e.phone
				this.userid = e.id
			}

			// getIndexUserList
		},
		computed: {},
		// onLoad(e) {

		// },
		onShareAppMessage(res) {
			return {
				title: '美亿联免单节',
				path: '/pages/index/index?id=' + uni.getStorageSync('userinfo').user_id + '&phone=' + uni.getStorageSync(
					'userinfo').mobile,
				imageUrl: this.baseUrl.baseUrl + this.image[0],
				desc: '多城联动 美亿联免单节',
				content: '多城联动 美亿联免单节',
				success(res) {
					uni.showToast({
						title: '分享成功'
					})
				},
				fail(res) {
					uni.showToast({
						title: '分享失败',
						icon: 'none'
					})
				}
			}
		},
		methods: {
			toLogin() {
				uni.navigateTo({
					url: `/pagesuser/public/login?id=${this.userid}&phone=${this.phone}`
				})
			},
			refresh() {
				this.getuser()
				this.getlist()
				this.triggered = false
			},
			refresherrefresh() {
				console.log("自定义下拉刷新被触发");
				let _this = this;
				// if (_this._refresherTriggered) {
				// 	return;
				// }
				// _this._refresherTriggered = true;
				//界面下拉触发，triggered可能不是true，要设为true
				if (!_this.refresherTriggered) {
					_this.refresherTriggered = true;
				}
				this.loadStoreData();
			},
			refresherrestore() {
				console.log("自定义下拉刷新被复位");
				let _this = this;
				_this.refresherTriggered = false;
				// _this._refresherTriggered = false;
			},
			refresherabort() {
				console.log("自定义下拉刷新被中止	");
				let _this = this;
				_this.refresherTriggered = false;
				// _this._refresherTriggered = false;
			},
			loadStoreData() {
				this.page = 1
				let _this = this;
				this.getuser()
				this.getlist()
				setTimeout(() => {
					_this.refresherTriggered = false; //触发onRestore，并关闭刷新图标
					// _this._refresherTriggered = false;
				}, 1000)
			},



			more() {
				this.page++
				this.getgoods()
			},
			getlist() {
				// this.init()
				this.$http.post('getIndexImgTel', {}).then(res => {
					console.log(res, 'res', this.baseUrl.baseUrl)
					this.image = res.data.images
					this.kf_tel = res.data.kf_tel
					this.payamount = res.data.payamount
				}).catch(e => {})

				this.$http.post('getIndexInfo', {}).then(res => {
					console.log(res, 'res', this.baseUrl.baseUrl)
					this.form = res.data

				}).catch(e => {})
				// 商家分类
				this.$http.post('getStoreType', {}).then(res => {
					console.log(res, 'res', this.baseUrl.baseUrl)
					// this.form=res.data
					this.getStoreType = res.data.list
				}).catch(e => {})

				// 推荐商家
				this.getgoods()
				// 推荐商家列表
				this.$http.post('getStoreList', {}).then(res => {
					console.log(res, 'res', this.baseUrl.baseUrl)
					// this.form=res.data
					this.getStoreList = res.data.list
				}).catch(e => {})
				//必去商家
				this.$http.post('getIndexMustStore', {}).then(res => {
					console.log(res, 'res', this.baseUrl.baseUrl)
					this.datas = res.data
					// this.form=res.data
					// this.getStoreList=res.data.list
				}).catch(e => {})
				// 首页参与列表
				this.$http.post('getIndexUserList', {}).then(res => {
					// console.log(res,'res',this.baseUrl.baseUrl)
					this.userlist = res.data.list
					// this.form=res.data
					// this.getStoreList=res.data.list
				}).catch(e => {})
			},
			getgoods(isMore) {
				this.$http.post('promotionStore', {
					page: this.page
				}).then(res => {
					if (res.data.list.length > 0) {
						this.promotionStoretrue = true
					}
					if (Math.ceil(res.data.total_num / 5) == this.page) {
						this.promotionStoretrue = false
					}
					// res.data.list.forEach((item)=>{
					// 	this.promotionStore.push(item)
					// })
					if (isMore) {
						this.promotionStore = this.promotionStore.concat(res.data.list)
					} else {
						this.promotionStore = res.data.list
					}
				}).catch(e => {})
			},
			getuser() {
				if (uni.getStorageSync('token')) {
					this.isshow = true
					this.avatars = uni.getStorageSync('userinfo').avatar
					this.is_members = uni.getStorageSync('userinfo').is_members
					this.imglist[2].istrue = true
					this.imglist[2].bottom = '140px'
					if (uni.getStorageSync('userinfo').is_members == 1) {
						this.imglist[1].istrue = true
						this.imglist[2].bottom = '210px'
					}

				} else {
					this.isshow = false
					this.avatars = ''
					this.imglist[2].istrue = false
					this.imglist[2].bottom = '210px'
					this.imglist[1].istrue = false
					this.is_members = ''
				}
			},
			tc() {
				uni.removeStorageSync('token')
				uni.removeStorageSync('userinfo')
				this.getuser()
			},
			fuwu() {
				uni.navigateTo({
					url: '/pages/shop/dingdan'
				})
			},
			scroll(e) {
				//记录scroll  位置
				this.oldScrollTop = e.detail.scrollTop
			},
			toid(e) {
				console.log(e)
				this.toView = e
			},
			toDetail(url) {
				uni.navigateTo({
					url
				})
			},

			gourl(type) {
				console.log(type)
				if (type == 'grzx') {
					if (uni.getStorageSync('token')) {
						uni.navigateTo({
							url: '/pagesuser/user/user'
						})
					} else {
						uni.showToast({
							title: '请登录后操作',
							icon: 'none'
						})
						setTimeout(() => {
							// this.phone=e.phone
							// this.userid=e.id
							uni.navigateTo({
								url: `/pagesuser/public/login?id=${this.userid}&phone=${this.phone}`
							})
						}, 1000)
					}

				} else if (type == 'sjru') {
					this.userToPage('/pages/merchant/recruitment');
				} else if (type == 'top') {
					this.scrollTop = this.oldScrollTop
					this.$nextTick(() => {
						this.scrollTop = 0
					})

				}
			},
			pay(img, payamount) {
				if (uni.getStorageSync('token')) {
					uni.navigateTo({
						url: `/pagesuser/user/orders?img=${img}&payamount=${payamount}`
					})
				} else {
					uni.showToast({
						title: '请登录后操作',
						icon: 'none'
					})
					setTimeout(() => {
						// if(this.userid){
						uni.navigateTo({
							url: `/pagesuser/public/login?id=${this.userid}&phone=${this.phone}`
						})
						// }else{
						uni.reLaunch({
							url: '/pagesuser/public/login'
						})
						// }

					}, 500)
				}

			},
			call(e) {
				uni.makePhoneCall({
					phoneNumber: e
				});
			},
			// ...mapActions(['SAVE_HOME_PRODUCTS']),
			// getHomeProducts() {
			// 	this.$http.get('home.products').then(res => {
			// 		this.data = res.data
			// 	}).catch(e => {
			// 	})
			// },
			// init() {
			// 	return Promise.all([this.getHomeProducts(), this.getNavData()])
			// },
			// getNavData() {
			// 	this.$http.post('nav', {
			// 		nav_type: [0, 1, 2]
			// 	}).then(res => {
			// 		this.carouselList = res.data[0] || []
			// 		this.navList = res.data[1] || []
			// 		this.adList = res.data[2] || []
			// 		this.titleNViewBackground = this.carouselList[0] ? (this.carouselList[0].params ? (this.carouselList[0].params['color'] || '') : '') : ''
			// 	})
			// },
			// goCategory() {
			// 	uni.switchTab({
			// 		url: '/pages/category/category'
			// 	})
			// },
			// goGroupCategory(item) {
			// 	uni.navigateTo({
			// 		url: '/pages/product/list?groupon=1'
			// 	})
			// },
			// //轮播图切换修改背景色
			// swiperChange(e) {
			// 	const index = e.detail.current;
			// 	this.swiperCurrent = index;
			// 	this.titleNViewBackground = this.carouselList[index].params ? (this.carouselList[index].params.color|| '') : ''
			// },
			// navToDetailPage(item) {
			// 	uni.navigateTo({
			// 		url: '/pages/product/product?id=' + item.id
			// 	})
			// },
			// navToLink(item) {
			// 	this.$meRouter(item)
			// },
			// submit(e) {
			// 	this.goSearch(e.detail.value)
			// },
			// goSearch(kw) {
			// 	uni.navigateTo({
			// 		url: '/pages/product/list?kw=' + kw
			// 	})
			// }
		},
		// #ifndef MP
		// 标题栏input搜索框点击
		/* onNavigationBarSearchInputClicked: function(e) {
			console.log(e)
		}, */
		onNavigationBarSearchInputConfirmed: function(e) {
			this.goSearch(e.text)
		},
		//点击导航栏 buttons 时触发
		// onNavigationBarButtonTap(e) {
		// 	const index = e.index;
		// 	if (index === 0) {
		// 		/// this.$api.msg('点击了扫描');
		// 	} else if (index === 1) {
		// 		return false
		// 		// #ifdef APP-PLUS
		// 		const pages = getCurrentPages();
		// 		const page = pages[pages.length - 1];
		// 		const currentWebview = page.$getAppWebview();
		// 		currentWebview.hideTitleNViewButtonRedDot({
		// 			index
		// 		});
		// 		// #endif
		// 		uni.navigateTo({
		// 			url: '/pages/notice/notice'
		// 		})
		// 	}
		// },
		// #endif

		// onPullDownRefresh() {
		// 	this.init().then(e => {
		// 		uni.stopPullDownRefresh()
		// 	}).catch(e => {
		// 		uni.stopPullDownRefresh()
		// 	})
		// }
	}
</script>

<style lang="scss">
	/* #ifdef MP */
	.mp-search-box {
		position: absolute;
		left: 0;
		top: 30upx;
		z-index: 9999;
		width: 100%;
		padding: 0 80upx;

		.ser-input {
			flex: 1;
			height: 56upx;
			line-height: 56upx;
			text-align: center;
			font-size: 28upx;
			color: $font-color-base;
			border-radius: 20px;
			background: rgba(255, 255, 255, .6);
		}
	}

	page {
		.cate-section {
			position: relative;
			z-index: 5;
			border-radius: 16upx 16upx 0 0;
			margin-top: -20upx;
		}

		.carousel-section {
			padding: 0;

			.titleNview-placing {
				padding-top: 0;
				height: 0;
			}

			.carousel {
				.carousel-item {
					padding: 0;
				}
			}

			.swiper-dots {
				left: 45upx;
				bottom: 40upx;
			}
		}
	}

	/* #endif */


	page {
		background: #f5f5f5;
	}

	.m-t {
		margin-top: 16upx;
	}

	/* 头部 轮播图 */
	.carousel-section {
		position: relative;
		padding-top: 10px;

		.titleNview-placing {
			height: var(--status-bar-height);
			padding-top: 44px;
			box-sizing: content-box;
		}

		.titleNview-background {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 426upx;
			transition: .4s;
		}
	}

	.carousel {
		width: 100%;
		height: 350upx;

		.carousel-item {
			width: 100%;
			height: 100%;
			padding: 0 28upx;
			overflow: hidden;
		}

		image {
			width: 100%;
			height: 100%;
			border-radius: 10upx;
		}
	}

	.swiper-dots {
		display: flex;
		position: absolute;
		left: 60upx;
		bottom: 15upx;
		width: 72upx;
		height: 36upx;
		background-image: url();
		background-size: 100% 100%;

		.num {
			width: 36upx;
			height: 36upx;
			border-radius: 50px;
			font-size: 24upx;
			color: #fff;
			text-align: center;
			line-height: 36upx;
		}

		.sign {
			position: absolute;
			top: 0;
			left: 50%;
			line-height: 36upx;
			font-size: 12upx;
			color: #fff;
			transform: translateX(-50%);
		}
	}

	/* 分类 */
	.cate-section {
		display: flex;
		justify-content: space-around;
		align-items: center;
		flex-wrap: wrap;
		padding: 30upx 22upx;
		background: #fff;

		.cate-item {
			display: flex;
			flex-direction: column;
			align-items: center;
			font-size: $font-sm + 2upx;
			color: $font-color-dark;
		}

		/* 原图标颜色太深,不想改图了,所以加了透明度 */
		image {
			width: 88upx;
			height: 88upx;
			margin-bottom: 14upx;
			border-radius: 50%;
			opacity: .7;
			box-shadow: 4upx 4upx 20upx rgba(250, 67, 106, 0.3);
		}
	}

	.ad-1 {
		width: 100%;
		height: 210upx;
		padding: 10upx 0;
		background: #fff;

		image {
			width: 100%;
			height: 100%;
		}
	}

	/* 秒杀专区 */
	.seckill-section {
		padding: 4upx 30upx 24upx;
		background: #fff;

		.s-header {
			display: flex;
			align-items: center;
			height: 92upx;
			line-height: 1;

			.s-img {
				width: 140upx;
				height: 30upx;
			}

			.tip {
				font-size: $font-base;
				color: $font-color-light;
				margin: 0 20upx 0 40upx;
			}

			.timer {
				display: inline-block;
				width: 40upx;
				height: 36upx;
				text-align: center;
				line-height: 36upx;
				margin-right: 14upx;
				font-size: $font-sm+2upx;
				color: #fff;
				border-radius: 2px;
				background: rgba(0, 0, 0, .8);
			}

			.icon-you {
				font-size: $font-lg;
				color: $font-color-light;
				flex: 1;
				text-align: right;
			}
		}

		.floor-list {
			white-space: nowrap;
		}

		.scoll-wrapper {
			display: flex;
			align-items: flex-start;
		}

		.floor-item {
			width: 150upx;
			margin-right: 20upx;
			font-size: $font-sm+2upx;
			color: $font-color-dark;
			line-height: 1.8;

			image {
				width: 150upx;
				height: 150upx;
				border-radius: 6upx;
			}

			.price {
				color: $uni-color-primary;
			}

		}
	}

	.f-header {
		display: flex;
		align-items: center;
		height: 140upx;
		padding: 6upx 30upx 8upx;
		background: #fff;

		image {
			flex-shrink: 0;
			width: 80upx;
			height: 80upx;
			margin-right: 20upx;
		}

		.tit-box {
			flex: 1;
			display: flex;
			flex-direction: column;
		}

		.tit {
			font-size: $font-lg +2upx;
			color: #font-color-dark;
			line-height: 1.3;
		}

		.tit2 {
			font-size: $font-sm;
			color: $font-color-light;
		}

		.icon-you {
			font-size: $font-lg +2upx;
			color: $font-color-light;
		}
	}

	/* 团购楼层 */
	.group-section {
		background: #fff;

		.g-swiper {
			height: 650upx;
			padding-bottom: 30upx;
		}

		.g-swiper-item {
			width: 100%;
			padding: 0 30upx;
			display: flex;
		}

		image {
			width: 100%;
			height: 460upx;
			border-radius: 4px;
		}

		.g-item {
			display: flex;
			flex-direction: column;
			overflow: hidden;
		}

		.left {
			flex: 1.2;
			margin-right: 24upx;

			.t-box {
				padding-top: 20upx;
			}
		}

		.right {
			flex: 0.8;
			flex-direction: column-reverse;

			.t-box {
				padding-bottom: 20upx;
			}
		}

		.t-box {
			height: 160upx;
			font-size: $font-base+2upx;
			color: $font-color-dark;
			line-height: 1.6;
		}

		.price {
			color: $uni-color-primary;
		}

		.m-price {
			font-size: $font-sm+2upx;
			text-decoration: line-through;
			color: $font-color-light;
			margin-left: 8upx;
		}

		.pro-box {
			display: flex;
			align-items: center;
			margin-top: 10upx;
			font-size: $font-sm;
			color: $font-base;
			padding-right: 10upx;
		}

		.progress-box {
			flex: 1;
			border-radius: 10px;
			overflow: hidden;
			margin-right: 8upx;
		}
	}

	/* 分类推荐楼层 */
	.hot-floor {
		width: 100%;
		overflow: hidden;
		margin: 20upx 0;

		.cat_name {
			background: #fff;
			margin-left: 5px;
			padding: 20upx 0 20upx 20upx;
			border-left: 3px solid #FC7592;
			font-size: $font-base + 4upx;
		}

		.floor-img-box {
			width: 100%;
			height: 320upx;
			position: relative;

			&:after {
				content: '';
				position: absolute;
				left: 0;
				top: 0;
				width: 100%;
				height: 100%;
				background: linear-gradient(rgba(255, 255, 255, .06) 30%, #f8f8f8);
			}
		}

		.floor-img {
			width: 100%;
			height: 100%;
		}

		.floor-list {
			white-space: nowrap;
			padding: 20upx;
			padding-right: 50upx;
			border-radius: 6upx;
			margin-left: 10upx;
			background: #fff;
			box-shadow: 1px 1px 5px rgba(0, 0, 0, .2);
			position: relative;
			z-index: 1;
		}

		.scoll-wrapper {
			display: flex;
			align-items: flex-start;
		}

		.floor-item {
			width: 180upx;
			margin-right: 20upx;
			font-size: $font-sm+2upx;
			color: $font-color-dark;
			line-height: 1.8;

			image {
				width: 180upx;
				height: 180upx;
				border-radius: 6upx;
			}

			.price {
				color: $uni-color-primary;
			}
		}

		.more {
			display: flex;
			align-items: center;
			justify-content: center;
			flex-direction: column;
			flex-shrink: 0;
			width: 180upx;
			height: 180upx;
			border-radius: 6upx;
			background: #f3f3f3;
			font-size: $font-base;
			color: $font-color-light;

			text:first-child {
				margin-bottom: 4upx;
			}
		}
	}

	/* 猜你喜欢 */
	.guess-section {
		display: flex;
		flex-wrap: wrap;
		padding: 0 30upx;
		background: #fff;

		.guess-item {
			display: flex;
			flex-direction: column;
			width: 48%;
			padding-bottom: 40upx;

			&:nth-child(2n+1) {
				margin-right: 4%;
			}
		}

		.image-wrapper {
			width: 100%;
			height: 330upx;
			border-radius: 3px;
			overflow: hidden;

			image {
				width: 100%;
				height: 100%;
				opacity: 1;
			}
		}

		.title {
			font-size: $font-lg;
			color: $font-color-dark;
			line-height: 80upx;
		}

		.price {
			font-size: $font-lg;
			color: $uni-color-primary;
			line-height: 1;
		}

		.under-price {
			font-size: $font-base;
			color: gray;
			text-decoration: line-through;
		}
	}

	.coupon-box {
		padding: 20upx;
		background: #fff;
		margin: 20upx 0;
		display: flex;

		.coupon-item {
			width: 70vw;
			display: flex;
			font-size: $font-base;
			background: #F85169;
			color: #fff;
			border-radius: 10upx;

			.left {
				flex: 2;
				display: flex;
				flex-direction: column;
				padding: 20upx;
			}

			.line {
				width: 26upx;
				border: 1px solid #fff;
				display: flex;
				justify-content: space-between;
				position: relative;

				.circle {
					width: 22upx;
					height: 22upx;
					border-radius: 50%;
					background: #fff;
					position: absolute;

					&.l {

						top: -18upx;
					}

					&.r {
						bottom: -18upx;
					}
				}
			}

			.right {
				flex: 1;
				display: flex;
				flex-direction: column;
				padding: 20upx;
				justify-content: center;
				align-items: center;
			}

			.txt {
				&.big-txt {
					font-size: $font-base + 6upx;
					margin: 10upx 0;
				}
			}
		}
	}
</style>
